object FunDetails01 {
  def main(args: Array[String]): Unit = {
    val pig1 = new Pig
    val pig2 = toPig(19,pig1)
    println(pig2.name)
    println(pig1.hashCode() == pig2.hashCode())
  }
  def toPig(n: Int, pig: Pig): Pig = {
    if (n >= 18) {
      pig.name = "⼤胖猪"
    }
    return pig
  }
}
class Pig {
  var name = "⼩胖猪"
}
